import request from '@/utils/request'

// 查询消息记录列表
export function listMessage(query) {
  return request({
    url: '/message/message/list',
    method: 'get',
    params: query
  })
}

export function userList() {
  return request({
    url: '/message/message/userList',
    method: 'get',
  })
}

export function addFriend(userId) {
  return request({
    url: '/message/message/addFriend/' + userId,
    method: 'post',
  })
}

export function getUserById(userId) {
  return request({
    url: '/message/message/getUserById/' + userId,
    method: 'get',
  })
}

// 查询消息记录详细
export function getMessage(id) {
  return request({
    url: '/message/message/' + id,
    method: 'get'
  })
}

// 查询好友
export function byUserId(userId) {
  return request({
    url: '/message/message/byUserId/' + userId,
    method: 'get'
  })
}


// 查询订单
export function getOrderListByUserId(userId) {
  return request({
    url: '/message/message/getOrderListByUserId/' + userId,
    method: 'get'
  })
}

// 新增消息记录
export function addMessage(data) {
  return request({
    url: '/message/message',
    method: 'post',
    data: data
  })
}

// 修改消息记录
export function updateMessage(data) {
  return request({
    url: '/message/message',
    method: 'put',
    data: data
  })
}

// 删除消息记录
export function delMessage(id) {
  return request({
    url: '/message/message/' + id,
    method: 'delete'
  })
}
